<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        let persons = [
    { "username": "xiaoming1", "password": "1111" },
    { "username": "xiaoming2", "password": "222" },
    { "username": "xiaoming3", "password": "33333" }
    ]

    let user = { username: "xiaoming1",password:"1111"}

    let al = persons.find((item) => item.username === user.username && item.password === user.password)
    document.write(al !== undefined ? '登录成功' : '用户名或密码错误')
    </script>
</body>

</html>